<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>实事显示时间</title>
 <script type="text/javascript">
	function Printe()
	{
		var date=new Date();
		var text="北京时间:"+date.toLocaleString();
		var obj= document.getElementById("span-text");
		obj.innerHTML=text;
	}
	function aler()
	{
		window.alert("ces");
	}
	var time_ID=0;
	function showtime(event)
	{
		
		if(event==true)
		{
			time_ID=window.setInterval("Printe()",1000);
		}
		else
		{
			clearTimeout(time_ID);
		}
	}
	
 </script>
 </head>
 <body onload="Printe()">
	<span id="span-text"></span>
	<input type="button" onclick="showtime(true)" value="开始">
	<input type="button" onclick="showtime(false)" value="停止">
	<!--<script type="text/javascript">
	Printe();
	</script>-->
 </body>
 </html>